
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
// 导入网络请求包
import { $http } from '@escook/request-miniprogram'
import requestErrorToast from './utils/requestErrorToast.js'
// 导入vuex仓库
import store from '@/store/store.js'
uni.$showMsg = requestErrorToast.requestErrorToast
uni.$http = $http

$http.baseUrl = 'https://api-hmugo-web.itheima.net/'

$http.beforeRequest = function (options) {
  // do somethimg...
  uni.showLoading({
    title: '加载中'
  })
}

$http.afterRequest = function () {
  // do something...
  uni.hideLoading(1)
}

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App,
    store
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif